#include "mainwindow.h"
#include "ui_mainwindow.h"

MainWindow::MainWindow(QWidget *parent) :
    QMainWindow(parent),
    ui(new Ui::MainWindow)
{
    ui->setupUi(this);
    video = ui->imageView;
    connect(ui->buttonCapture,QPushButton::clicked,video,video->captureImage);
    connect(ui->imageView,&Video::sendImage,this, this->displayCapture);
}

MainWindow::~MainWindow()
{
    delete ui;
}

void MainWindow::displayCapture(int, QImage image)
{
   QPixmap ap = QPixmap::fromImage(image);
   ap = ap.scaled (150,200 , Qt::IgnoreAspectRatio,Qt::FastTransformation);
   ui->imageCapture->setPixmap(ap);
}
